var express = require('express');
const { userModel } = require('../model/model');
var router = express.Router();
/* GET home page. */
router.post('/login', async(req, res, next)=>{
  let {user,pwd}=req.body
  let data=await userModel.find({user,pwd})
  if(data.length>0){
    res.send({
      code:200,
      msg:'登录成功'
    })
  }else{
    res.send({
      code:400,
      msg:'账号或密码错误'
    })
  }
});



module.exports = router;
